misc/jsParse.js \
misc/modemManager.js \
misc/params.js \
- misc/screenSaver.js \
misc/util.js \
perf/core.js \
ui/altTab.js \
+++ /dev/null
-// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-
-const Gio = imports.gi.Gio;
-const Lang = imports.lang;
-
-const ScreenSaverIface = <interface name="org.gnome.ScreenSaver">
-<method name="GetActive">
- <arg type="b" direction="out" />
-</method>
-<method name="Lock" />
-<method name="SetActive">
- <arg type="b" direction="in" />
-</method>
-<signal name="ActiveChanged">
- <arg type="b" direction="out" />
-</signal>
-</interface>;
-
-const ScreenSaverInfo = Gio.DBusInterfaceInfo.new_for_xml(ScreenSaverIface);
-
-function ScreenSaverProxy() {
- var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
- g_interface_name: ScreenSaverInfo.name,
- g_interface_info: ScreenSaverInfo,
- g_name: 'org.gnome.ScreenSaver',
- g_object_path: '/org/gnome/ScreenSaver',
- g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
- Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
- self.init(null);
- self.screenSaverActive = false;
-
- self.connectSignal('ActiveChanged', function(proxy, senderName, [isActive]) {
- self.screenSaverActive = isActive;
- });
- self.connect('notify::g-name-owner', function() {
- if (self.g_name_owner) {
- self.GetActiveRemote(function(result, excp) {
- if (result) {
- let [isActive] = result;
- self.screenSaverActive = isActive;
- }
- });
- } else
- self.screenSaverActive = false;
- });
-
- return self;
-}
const Shell = imports.gi.Shell;
const Main = imports.ui.main;
const ShellMountOperation = imports.ui.shellMountOperation;
-const ScreenSaver = imports.misc.screenSaver;
const GnomeSession = imports.misc.gnomeSession;
const GNOME_SESSION_AUTOMOUNT_INHIBIT = 16;
if (!haveSystemd())
this.ckListener = new ConsoleKitManager();
- this._ssProxy = new ScreenSaver.ScreenSaverProxy();
- this._ssProxy.connectSignal('ActiveChanged',
- Lang.bind(this, this._screenSaverActiveChanged));
+ Main.screenShield.connect('lock-status-changed', Lang.bind(this, this._lockStatusChanged));
this._volumeMonitor = Gio.VolumeMonitor.get();
}));
},
- _screenSaverActiveChanged: function(object, senderName, [isActive]) {
- if (!isActive) {
+ _lockStatusChanged: function(shield, locked) {
+ if (!locked) {
this._volumeQueue.forEach(Lang.bind(this, function(volume) {
this._checkAndMountVolume(volume);
}));
if (!this.isSessionActive())
return;
- if (this._ssProxy.screenSaverActive)
+ if (Main.screenShield.locked)
return;
global.play_theme_sound(0, 'device-added-media');
if (!this.isSessionActive())
return;
- if (this._ssProxy.screenSaverActive)
+ if (Main.screenShield.locked)
return;
global.play_theme_sound(0, 'device-removed-media');
if (!this.isSessionActive())
return;
- if (this._ssProxy.screenSaverActive) {
+ if (Main.screenShield.locked) {
if (this._volumeQueue.indexOf(volume) == -1)
this._volumeQueue.push(volume);
const DND = imports.ui.dnd;
const Main = imports.ui.main;
const Params = imports.misc.params;
-const ScreenSaver = imports.misc.screenSaver;
const Tweener = imports.ui.tweener;
const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5;
this._monitors = [];
this._inOverview = false;
+ this._isLocked = false;
this._updateRegionIdle = 0;
this._freezeUpdateCount = 0;
global.screen.connect('notify::n-workspaces',
Lang.bind(this, this._queueUpdateRegions));
- this._screenSaverActive = false;
- this._screenSaverProxy = new ScreenSaver.ScreenSaverProxy();
- this._screenSaverProxy.connectSignal('ActiveChanged', Lang.bind(this, function(proxy, senderName, [isActive]) {
- this._onScreenSaverActiveChanged(isActive);
- }));
- this._screenSaverProxy.GetActiveRemote(Lang.bind(this, function(result, err) {
- if (!err)
- this._onScreenSaverActiveChanged(result[0]);
- }));
-
this._relayout();
},
Lang.bind(this, this._overviewShowing));
Main.overview.connect('hidden',
Lang.bind(this, this._overviewHidden));
+ Main.screenShield.connect('lock-status-changed',
+ Lang.bind(this, this._lockStatusChanged));
},
addActor: function(actor, params) {
_updateVisibility: function() {
for (let i = 0; i < this._trackedActors.length; i++) {
+ let actorData = this._trackedActors[i], visible;
if (!actorData.trackFullscreen)
continue;
-
- let actorData = this._trackedActors[i], visible;
if (!actorData.isToplevel)
continue;
- if (this._screenSaverActive)
- visible = false;
- else if (this._inOverview)
+ if (this._inOverview || this._isLocked)
visible = true;
else if (this.findMonitorForActor(actorData.actor).inFullscreen)
visible = false;
this._queueUpdateRegions();
},
+ _lockStatusChanged: function(shield, locked) {
+ this._isLocked = locked;
+ this._updateVisibility();
+ this._queueUpdateRegions();
+ },
+
_relayout: function() {
this._monitors = this._layoutManager.monitors;
this._primaryMonitor = this._layoutManager.primaryMonitor;
this._queueUpdateRegions();
},
- _onScreenSaverActiveChanged: function(screenSaverActive) {
- this._screenSaverActive = screenSaverActive;
- this._updateVisibility();
- this._queueUpdateRegions();
- },
-
_findMonitorForRect: function(x, y, w, h) {
// First look at what monitor the center of the rectangle is at
let cx = x + w/2;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
-const ScreenSaver = imports.misc.screenSaver;
const Util = imports.misc.util;
const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
this._accountMgr = Tp.AccountManager.dup();
this._upClient = new UPowerGlib.Client();
- this._screenSaverProxy = new ScreenSaver.ScreenSaverProxy();
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this._iconBox = new St.Bin();
_onLockScreenActivate: function() {
Main.overview.hide();
- this._screenSaverProxy.LockRemote();
+ Main.screenShield.lock();
},
_onLoginScreenActivate: function() {
Main.overview.hide();
- // Ensure we only move to GDM after the screensaver has activated; in some
- // OS configurations, the X server may block event processing on VT switch
- this._screenSaverProxy.SetActiveRemote(true, Lang.bind(this, function() {
- this._userManager.goto_login_session();
- }));
+ Main.screenShield.lock();
+ this._userManager.goto_login_session();
},
_onQuitSessionActivate: function() {
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
this._session.ShutdownRemote();
} else {
- // Ensure we only suspend after locking the screen
- this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
- this._upClient.suspend_sync(null);
- }));
+ Main.screenShield.lock();
+ this._upClient.suspend_sync(null);
}
}
});